package com.kjc.demo.basic.init;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.kjc.demo.basic.service.InitGlableService;

import lombok.extern.slf4j.Slf4j;

/**
 * spring boot 初始化执行runner
 */
@Slf4j
@Component
public class InitSystemConfigRunner implements CommandLineRunner {
	
	@Autowired
	InitGlableService initGlableService;
	
    @Override
    public void run(String... args) throws Exception {
    	initGlableService.initMap();
    	ObjectMapper mapper = new ObjectMapper();
    	log.info(mapper.writeValueAsString(initGlableService.map));
    }
}
